<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="container clearfix">
      <div class="main float"></div>
      <div class="left float"></div>
      <div class="right float"></div>
    </div>
    <style>
      .container {
        padding: 0 200px;
        background-color: #eee;
      }
      /* 清除浮动 */
      .clearfix::after {
        content: "";
        display: table;
        clear: both;
      }
      /* 关键 */
      .float {
        float: left;
      }
      .main {
        width: 100%;
        height: 200px;
        background-color: #ccc;
      }
      .left {
        width: 200px;
        height: 200px;
        /* ---关键--- */
        position: relative;
        right: 200px;
        margin-left: -100%;
        /* ---关键--- */
        background-color: orange;
      }
      .right {
        width: 200px;
        height: 200px;
        /* ---关键--- */
        margin-right: -200px;
        /* ---关键--- */
        background-color: skyblue;
      }
    </style>
  </body>
</html>
